Skip to content

feat(low-code): pass top level params to PropertiesFromEndpoint requester #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

darynaishchenko
Copy link
Contributor

@darynaishchenko darynaishchenko commented May 13, 2025

Summary by CodeRabbit

  • Refactor

    • Enhanced parameter propagation to support nested components without explicit types, improving handling of complex nested structures.
    • Extended recognition of JSON schema object types for more accurate processing.
  • Tests

    • Added a test to verify correct deep propagation of parameters across nested declarative components, including property chunking configurations.

@darynaishchenko darynaishchenko self-assigned this May 13, 2025
@github-actions github-actions bot added the enhancement New feature or request label May 13, 2025
Copy link
Contributor

coderabbitai bot commented May 13, 2025

📝 Walkthrough

Walkthrough

The changes refine the parameter propagation logic in the manifest component transformer to support recursive propagation into nested components without an explicit "type" field. Two new helper methods detect and process nested components recursively. A new unit test verifies deep propagation of parameters and entity fields through a complex nested component structure.

Changes

File(s) Change Summary
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py Modified propagate_types_and_parameters to defer early return and enable recursive parameter propagation into nested components lacking a "type". Added _has_nested_components and _process_nested_components helper methods. Extended _is_json_schema_object to recognize additional type values.
unit_tests/sources/declarative/parsers/test_manifest_component_transformer.py Added test_propagate_property_chunking to verify deep propagation of $parameters and entity fields throughout nested declarative stream components.

Possibly related PRs

Suggested reviewers

  • maxi297
  • bazarnov

Would you like me to suggest adding anyone else to the reviewer list, or does this cover the relevant expertise, wdyt?

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between d9f0d6f and 1736750.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py (1)

1-3822: Overall feedback on parameter inheritance approach

The code consistently implements parameter inheritance in all three places where nested components with parameters are created. This follows good software design principles by establishing a consistent pattern throughout the codebase.

To help future developers understand this pattern, would it be helpful to add a brief comment explaining the parameter inheritance? Maybe something like "# Merge parent model parameters into nested component parameters to allow parameter inheritance"? Wdyt?

🧰 Tools
🪛 GitHub Actions: Linters

[error] 1-1: Ruff formatting check failed. File would be reformatted. Run 'ruff format' to fix code style issues.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13a38db and ed0e804.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py (3 hunks)
🧰 Additional context used
🪛 GitHub Actions: Linters
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

[error] 1-1: Ruff formatting check failed. File would be reformatted. Run 'ruff format' to fix code style issues.

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Analyze (python)
🔇 Additional comments (3)
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py (3)

2761-2763: Looks good - passing parameters from parent model to nested requester

The code now merges parameters from the parent model into the nested requester component, which allows top-level parameters to be accessible in the PropertiesFromEndpoint requester. This is a nice improvement for parameter propagation.


2814-2818: Nice parameter inheritance implementation - parent params merge into property_list model

Similar to the previous change, this properly passes parameters from the parent QueryProperties model to the nested property_list model. This ensures configuration values defined at the top level are available to the nested components, which is good for consistency.

One small thing to consider: What happens if there are parameter key collisions? Currently, parent parameters would override child parameters - is that the intended behavior? Wdyt?


3056-3062: I like this consistent pattern for parameter propagation

Following the same pattern as the other changes, this passes parent model parameters to the query properties component when found in request parameters. This makes the parameter inheritance behavior consistent across all three locations.

The implementation properly handles the None case for parameters and maintains the same merging logic as the other instances.

@darynaishchenko
Copy link
Contributor Author

darynaishchenko commented May 13, 2025

/autofix

Auto-Fix Job Info

This job attempts to auto-fix any linting or formating issues. If any fixes are made,
those changes will be automatically committed and pushed back to the PR.

Note: This job can only be run by maintainers. On PRs from forks, this command requires
that the PR author has enabled the Allow edits from maintainers option.

PR auto-fix job started... Check job output.

✅ Changes applied successfully.

octavia-squidington-iii and others added 2 commits May 13, 2025 13:46
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py (1)

202-207: Suggestion for _is_property_chunking_component

The method correctly identifies components with a "QueryProperties" subcomponent. Would an early return pattern be cleaner here, wdyt?

@staticmethod
def _is_property_chunking_component(propagated_component: Mapping[str, Any]) -> bool:
-    has_property_chunking = False
    for k, v in propagated_component.items():
        if isinstance(v, dict) and v.get("type") == "QueryProperties":
-            has_property_chunking = True
+            return True
-    return has_property_chunking
+    return False
unit_tests/sources/declarative/parsers/test_manifest_component_transformer.py (1)

465-571: Great test coverage for the property chunking feature!

The test properly verifies deep parameter propagation through nested component structures including property chunking. It confirms that $parameters and entity fields are correctly injected at every level.

A suggestion that might make the test a bit more readable - would it make sense to create helper methods for building parts of these complex test structures? This could make future tests easier to construct as well, wdyt?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 708ceeb and f4ca661.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py (2 hunks)
  • unit_tests/sources/declarative/parsers/test_manifest_component_transformer.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)
🔇 Additional comments (2)
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py (2)

133-146: LGTM: Special handling for PropertyChunking components

The added logic properly addresses the case where a component without a "type" field might contain a "PropertyChunking" object that needs parameter propagation. This solves the issue of parameters not being passed to objects within request parameters.


209-226: LGTM: Property chunking processing method

The method correctly processes components containing PropertyChunking objects by recursively propagating parameters. The implementation is clean and follows the pattern established elsewhere in the codebase.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py (1)

216-223: Good addition for detecting nested components!

This helper method clearly identifies when a component contains nested typed components. Would a more concise implementation using any() be clearer, wdyt?

- def _has_nested_components(propagated_component: Mapping[str, Any]) -> bool:
-     has_nested_components = False
-     for k, v in propagated_component.items():
-         if isinstance(v, dict) and v.get("type"):
-             has_nested_components = True
-     return has_nested_components
+ def _has_nested_components(propagated_component: Mapping[str, Any]) -> bool:
+     return any(isinstance(v, dict) and v.get("type") for v in propagated_component.values())
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4ca661 and 69eb0cf.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py (2 hunks)
🧰 Additional context used
🪛 GitHub Actions: Linters
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py

[error] 149-149: mypy type checking error: invalid syntax

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Analyze (python)
🔇 Additional comments (4)
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py (4)

133-140: Clear improvement to handling JSON schema objects!

The logic now specifically checks if we're dealing with a JSON schema object, handling both direct "object" type and nullable object types correctly. This makes the early return condition more precise.


211-214: Nice refinement to JSON schema object detection!

The method now correctly handles both direct "object" type and the nullable variant ["null", "object"]. This makes the code more robust when dealing with different JSON schema formats.


224-241: Great implementation of nested component processing!

This helper method effectively handles the recursive parameter propagation into nested components. The approach ensures that all nested components receive the appropriate parameters, maintaining consistency throughout the component tree.


141-167:

❌ Incorrect review comment

Great enhancement for parameter propagation in nested components without types!

This addition nicely addresses the use case where a parent component doesn't have a type but contains nested components that should receive parameter propagation. The comment example helps clarify the intended use case.

There appears to be a mypy syntax error on line 149 in the comment example - the indentation in the YAML example might be causing issues with syntax checking. Would adjusting the indentation in the example help resolve the pipeline failure, wdyt?


🏁 Script executed:

#!/bin/bash
# Check if the issue is with the comment indentation
rg -n "type: QueryProperties" airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py

Length of output: 145


Ignore the YAML indentation suggestion in comments—mypy doesn’t parse comments. It looks like the example is purely in a commented block, so adjusting its indentation won’t resolve any pipeline failures. Let’s investigate the actual error in the mypy logs to pinpoint the real issue.

Likely an incorrect or invalid review comment.

🧰 Tools
🪛 GitHub Actions: Linters

[error] 149-149: mypy type checking error: invalid syntax

Copy link
Contributor

@brianjlai brianjlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits and suggestions, but non-blocking and looks good to merge!

@darynaishchenko darynaishchenko merged commit 895756d into main May 15, 2025
25 of 27 checks passed
@darynaishchenko darynaishchenko deleted the daryna/low-code/pass-parameters-to-properties-from-endpoint branch May 15, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants